package com.fengxu.springcloud.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fengxu.springcloud.doman.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface OrderDao extends BaseMapper<Order> {

    // 新建订单
    @Insert("insert into t_order values (null,#{userID},#{productId},#{count},#{money},0)")
    void create(Order order);

    // 修改订单状态
    @Update("update t_order set status=#{status} where id=#{id}")
    void update(Long id, Integer status);
}
